﻿<UserControl x:Class="FiftyNine.Ag.OpenXML.Word.Sample.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" d:DesignHeight="480" d:DesignWidth="640">
    <UserControl.Resources>
        <Style x:Key="Label" TargetType="TextBlock">
            <Setter Property="FontSize" Value="14" />
            <Setter Property="Margin" Value="0,10" />
        </Style>
        <Style x:Key="TextBox" TargetType="TextBox">
            <Setter Property="Width" Value="300" />
            <Setter Property="Height" Value="35" />
            <Setter Property="FontSize" Value="18" />
            <Setter Property="Margin" Value="10,10,0,0" />
        </Style>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid VerticalAlignment="Center" HorizontalAlignment="Center">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <Border x:Name="ImageBorder" BorderThickness="1" BorderBrush="Black" 
                    Visibility="Collapsed" Margin="0,0,0,10" Padding="0" 
                    HorizontalAlignment="Center" VerticalAlignment="Center">
                <Image x:Name="MyImage" MaxWidth="300" MaxHeight="300" Stretch="Uniform" />
            </Border>

            <Grid Grid.Row="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <Button Content="SELECT IMAGE" Grid.ColumnSpan="2" FontSize="15" 
                        FontWeight="Bold" Click="SelectImage" />

                <TextBlock Text="Title:" Style="{StaticResource Label}" Grid.Row="1" />
                <TextBox x:Name="Title" Style="{StaticResource TextBox}" Grid.Row="1" 
                         Grid.Column="1" />

                <TextBlock Text="Text:" Style="{StaticResource Label}" Grid.Row="2" />
                <TextBox x:Name="Text" FontSize="12" Style="{StaticResource TextBox}" 
                         Grid.Row="2" Grid.Column="1" AcceptsReturn="True" Height="100" />

                <Button Content="SAVE" Grid.ColumnSpan="2" Grid.Row="3" FontSize="15" 
                        FontWeight="Bold" Click="Save" Margin="0,10,0,0" />
            </Grid>

        </Grid>
    </Grid>
</UserControl>
